import { createStore } from 'vuex';

export default createStore({
    state() {
        return {
            language: window.localStorage.getItem('lang') || 'zh-CN',
        };
    },
    mutations: {
        updateLanguage(state, lang) {
            state.language = lang;
            window.localStorage.setItem('lang', lang);
        },
    },
});
